//引入React
import React from 'react';

//引入路由
//Switch路由视图 Route路由规则 Redirect重定向
import { Switch, Route, Redirect } from 'react-router-dom'


//引入登录页面
import Login from './pages/Login/Login'
//引入注册页面
import Register from "./pages/Register/Register"
//引入大首页
import Index from './pages/Index/Index'

//引入列表页
import List from "./pages/List/List"
//引入详情页
import Detail from "./pages/Detail/Detail"
//引入购物车
import Shop from './pages/Shop/Shop'
//引入优惠券
import You from './pages/You/You'


function App() {
  return (
    <div className="App">
      {/* 配置路由 */}
      {/* 1.路由视图 */}
      <Switch>
        {/* 2.路由规则  配置路由*/}
        <Route path='/login' component={Login}></Route>
        <Route path='/register' component={Register}></Route>
        <Route path='/Index' component={Index}></Route>
        <Route path='/List' component={List}></Route>
        {/* 3.动态路由传参 占位符 */}
        <Route path='/Detail/:id' component={Detail}></Route>
        <Route path='/Shop/:id' component={Shop}></Route>
        <Route path='/You' component={You}></Route>
        <Redirect to='/login'></Redirect>
      </Switch>
    </div>
  );
}

export default App;
